Introduction to Robotics: Boe-Bot Servo Control |
Running Boe-Bot Backwards
|___________________________________________|___________________________________| |
|
|
To run both servos it takes about 24.6ms for a loop to run.
Therefore, the number of pulses to send = Time(sec)/.0246 PULSOUT 13, 850 NEXT |
|
When programming the BOE-Bot we often want to make it move a specific distance or to execute a particular turn. To do so, we need to figure out the circumference of the wheel (C = 2 ∏r). The BOE-Bot’s wheel radius is about 3.335 cm. Thus, the distance traveled by BOE-Bot with one complete turn of the wheel is approximately 21 cm.The distance, the BOE-Bot will travel, is controlled by sending the pulses to the servo for the correct amount of time. For example, if the pulsout command is given the value of 850, the servo will turn at about 50 RPM (0.83 revolutions per second). The speed will be:21 cm/rev × 0.83 rev/sec = 17.5 cm/sec.Thus, the time required for the BOE-Bot travel 100cm is: Time = 100cm / 17.5 = 5.7 sec.
Because we know the duration of the pulse and the duration of the pause, we can calculate the time for a single loop: Loop = 1.3ms +1.7ms + 20ms = 23ms Thus, the number
of loops required is: .
|